#ifndef MYBUTTON_H
#define MYBUTTON_H

#include <QMainWindow>
#include <QRect>
#include <QPainter>
#include <QString>
#include <QPixmap>
#include <QDebug>
#include <QPushButton>
#include <QPropertyAnimation>

class MyButton : public QPushButton
{
    Q_OBJECT
public:
    MyButton(QString pressImage,
                      QString releaseImage,
                      QWidget *parent = nullptr);

    /**
     * @brief paintEvent    绘制按钮图片
     * @param event
     */
    void paintEvent(QPaintEvent *event);

    /**
     * @brief buttonUp  按钮点击后向上动画
     */
    void buttonUp();

    /**
     * @brief buttonDown    按钮点击后向下动画
     */
    void buttonDown();

signals:

public slots:
protected:
    enum btnStat{
        Press,
        Release
    };
    int stat;
    QString mPressImage;
    QString mReleaseImage;
    void mousePressEvent(QMouseEvent *e);
    void mouseReleaseEvent(QMouseEvent *e);
};

#endif // MYBUTTON_H
